/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface M8Rd01 extends BasicModel<M8Rd01> {
  code?: string; // 单据号
  venCode?: string; // 供应商编号
  ddate?: string; // 单据日期
  createByName?: string; // create_by_name
  updateByName?: string; // update_by_name
  djStatus?: string; // 单据状态
  m8Rds01List?: any[]; // 子表列表
}

export const m8Rd01List = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/list', params });

export const m8Rd01ListData = (params?: M8Rd01 | any) =>
  defHttp.post<Page<M8Rd01>>({ url: adminPath + '/rd/rd01/m8Rd01/listData', params });

export const m8Rds01ListData = (params?: M8Rd01 | any) =>
  defHttp.post<Page<M8Rd01>>({ url: adminPath + '/rd/rd01/m8Rd01/m8Rds01ListData', params });

export const m8Rd01Form = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/form', params });

export const m8Rd01Save = (params?: any, data?: M8Rd01 | any) =>
  defHttp.postJson<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/save', params, data });

export const m8Rd01Delete = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/delete', params });


// 整单关闭
export const m8Rd01CloseOrder = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/closeOrder', params });

// 整单开启
export const m8Rd01OpenOrder = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/openOrder', params });

// 行关闭
export const m8Rd01CloseRow = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/closeRow', params });

// 行打开
export const m8Rd01OpenRow = (params?: M8Rd01 | any) =>
  defHttp.get<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/openRow', params });

export const m8Rd01ScanPicAddRow = (params?: M8Rd01 | any) =>
  defHttp.post<M8Rd01>({ url: adminPath + '/rd/rd01/m8Rd01/scanPicAddRow', params });